{# A picked key family: what it is for, how much it holds and has passed through (``redis_facts``), who reads it, and its newest key. #} {% from "components/macros/layout.html" import sparkline, stat_row %} {% from "components/macros/table.html" import data_table %} {% set facts = detail.facts if detail else {} %}

{{ row.family.name }}

{{ row.family.purpose }}

Written by {{ row.family.owner }} ยท {{ row.where }}

{{ stat_row((facts.figures or []) + [ ("Keys", "{:,}".format(row.count)), ("Memory", row.memory|filesizeformat), ("TTL", row.ttl_label or "none"), ("Last touched", row.idle_ago or "-"), ]) }} {% if facts.partial %}

Figures read its first {{ facts.partial }} keys.

{% endif %}
{% if facts.spark %}

The last hour, a minute at a time

{{ sparkline(facts.spark, "w-full h-full") }}
{% endif %} {% if facts.groups %}

Read by

{{ data_table([ {"key": "name", "label": "Group"}, {"key": "consumers", "label": "Readers", "align": "right"}, {"key": "pending", "label": "Unacked", "align": "right"}, {"key": "lag", "label": "Behind", "align": "right"}, ], facts.groups) }}
{% endif %} {% if detail and detail.key %} {% set dated = detail.rows|selectattr("when")|list %}

Newest key {{ detail.key }}

{{ data_table([ {"key": "a", "label": detail.columns[0]}, {"key": "b", "label": detail.columns[1], "align": "right"}, ] + ([{"key": "when", "label": "When", "align": "right"}] if dated else []), detail.rows, empty="Empty") }}
{% elif detail and detail.error %}

Could not read it: {{ detail.error }}

{% elif row.family.peek is false %}

Holds a credential: named here, never read.

{% else %}

No keys to show yet.

{% endif %}